package com.df.core.dao;

import com.df.core.entity.User;
import com.df.model.user.UserModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * Created by Administrator on 2016/10/10.
 */
public interface UserRepository extends JpaRepository<User, Long> {


    User findByUserName(String userName);

    @Query("from User u where u.userName=:name")
    User findUser(@Param("name") String userName);

    @Query(value = "select u from df_user u where u.user_name=:name")
    UserModel findUserModel(@Param("name") String userName);

}
